package com.yunquan.ohana.ui.calendar.lists.list.adapter

import androidx.databinding.ViewDataBinding
import com.yunquan.ohana.R
import com.yunquan.ohana.databinding.ItemListsListBinding
import com.yunquan.ohana.ui.calendar.lists.list.ListsListItemViewModel
import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter

class ListsListAdapter : BindingRecyclerViewAdapter<ListsListItemViewModel>() {
    override fun onBindBinding(binding: ViewDataBinding, variableId: Int, layoutRes: Int, position: Int, item: ListsListItemViewModel?) {
        super.onBindBinding(binding, variableId, layoutRes, position, item)
        if (binding is ItemListsListBinding) {
            val resources = binding.root.context.resources
            binding.vOut.helper.cornerRadius = resources.getDimensionPixelSize(R.dimen.dp_16).toFloat()
            binding.clInner.helper.cornerRadius = resources.getDimensionPixelSize(R.dimen.dp_16).toFloat()
        }
    }
}